<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height">
    <div class="flex-box border-hover-style">
      <div class="Showroom-parent" v-if="props.info.digitalShowroom">
        <digitalShowroomIcon :url="props.info.digitalShowroom" :id="props.info.id" />
      </div>
      <div
        class="outline-parent-bg"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style4/Level2outlineStyle6Bg.webp'})`,
        }"
      >
        <div class="content-box" :class="{ 'content-box2': !props.info.remarks && !props.info.value }">
          <p class="title-name" v-if="props.info.text">{{ props.info.text }}</p>
          <img class="line-img" :src="publicUrls + 'free/style4/Level2Style6Line.webp'" alt="" />
          <p class="sub-title" v-if="props.info.subTitle">{{ props.info.subTitle }}</p>
          <div
            class="cover"
            :style="{
              backgroundImage: `url(${publicUrls + 'free/style4/Level2Style6ImgBorder.webp'})`,
            }"
            :class="{
              cover3: !props.info.remarks,
            }"
            @click="ImgVisible = true"
            v-if="props.info.value"
          >
            <div class="img-box">
              <img class="cover-img" :src="urls + props.info.value + '?imageView2/3/format/webp'" alt="" />
            </div>
          </div>
          <div class="remarks" v-if="props.info.remarks">
            <TextMax
              :data="props.info.remarks"
              :infoData="props.info"
              :title="props.info.text"
              :row="props.info.value ? 3 : 9"
            ></TextMax>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
export default defineComponent({
  name: 'free4style6',
});
</script>
<script lang="ts" setup>
import { publicUrls, textType } from '@/utils/minxin';
import { getTextHtml } from '@/utils/minxin';
import { urls } from '@/utils/request/upload';
import { defineComponent, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/TextMax.vue';
import { useProjectStore } from '@/store';
import digitalShowroomIcon from '@/freeComponents/unitdigitalShowroom/style4.vue';

const ImgVisible = ref(false);
const store = useProjectStore();

const props = defineProps({
  info: {
    type: Object,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style lang="less" scoped>
.outline-parent {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  margin-left: 80px;
  margin-right: 90px;
}
.flex-box {
  width: 377px;
  height: 774px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}
.Showroom-parent {
  position: absolute;
  top: 23px;
  right: 13px;
  z-index: 21;
}
.outline-parent-bg {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  position: relative;
  padding-top: 13px;
}
.content-box2 {
  justify-content: flex-start !important;
  padding-top: calc(190px - 13px);
}
.content-box {
  width: 100%;
  height: 563px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.title-name {
  flex-shrink: 0;
  width: 216px;
  color: #5391a3;
  text-align: center;
  font-family: 'SourceHanSerifCN';
  font-size: 24px;
  font-style: normal;
  font-weight: 700;
  line-height: 28px; /* 116.667% */
}
.line-img {
  flex-shrink: 0;
  width: 376px;
  height: 22px;
  object-fit: cover;
  margin-top: 10px;
}
.sub-title {
  flex-shrink: 0;
  width: 337px;
  color: #333;
  text-align: center;
  font-family: 'PingFang SC';
  font-size: 18px;
  font-style: normal;
  font-weight: 400;
  line-height: 28px; /* 155.556% */
  margin-top: 10px;
  opacity: 0.8;
}
.cover3 {
  width: 294.495px !important;
  height: 294.495px !important;
  .img-box {
    width: 282px !important;
    height: 282px !important;
  }
}
.cover {
  flex-shrink: 0;
  width: 218px;
  height: 214px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  .img-box {
    width: 206px;
    height: 206px;
    border-radius: 50%;
    overflow: hidden;
    background-color: rgba(217, 217, 217, 1);
  }
  .cover-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.5s;
  }
  &:hover {
    .cover-img {
      transform: scale(1.2);
    }
  }
}
.remarks {
  flex-shrink: 0;
  width: 337px;
  margin-top: 10px;
}
::v-deep .van-text-ellipsis {
  color: rgba(51, 51, 51, 0.8) !important;
  font-family: 'PingFang SC' !important;
  font-size: 16px !important;
  font-style: normal;
  font-weight: 400;
  line-height: 32px; /* 200% */
  opacity: 0.8;
}
::v-deep .van-text-ellipsis__action::before {
  color: #83b0b3 !important;
  font-family: 'PingFang SC' !important;
  font-size: 16px !important;
  font-style: normal;
  font-weight: 500;
  line-height: 32px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
</style>
